#pragma once
#include <iostream>
#include <unistd.h>
#include <functional>

using task_t = std::function<void()>;//定义任务类型

void download()
{
    std::cout<<"我是一个下载任务，正在下载东西......"<<std::endl;
    sleep(3);
}

class task
{
    public:
    task()
    {}
    task(int x,int y):_x(x),_y(y)
    {}
    void execute()
    {
        _result  = _x+_y;
    }
    int X()
    {
        return _x;
    }
    int Y()
    {
        return _y;
    }
    private:
    int _x;
    int _y;
    int _result;
};